package com.gg.registration.model.hosp;

import com.gg.registration.model.base.BaseMongoEntity;
import lombok.Data;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

import java.util.Objects;

/**
 * <p>
 * Department
 * </p>
 *
 * @author qy
 */
@Data
@Document("Department")
public class Department extends BaseMongoEntity {
	
	private static final long serialVersionUID = 1L;

	@Indexed //普通索引
	private String hoscode;

	@Indexed(unique = true) //唯一索引
	private String depcode;

	private String depname;

	private String intro;

	private String bigcode;

	private String bigname;

	@Transient//不会被加入数据库
	private String timestamp;

	@Transient
	private String sign;

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}

	public String getHoscode() {
		return hoscode;
	}

	public void setHoscode(String hoscode) {
		this.hoscode = hoscode;
	}

	public String getDepcode() {
		return depcode;
	}

	public void setDepcode(String depcode) {
		this.depcode = depcode;
	}

	public String getDepname() {
		return depname;
	}

	public void setDepname(String depname) {
		this.depname = depname;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	public String getBigcode() {
		return bigcode;
	}

	public void setBigcode(String bigcode) {
		this.bigcode = bigcode;
	}

	public String getBigname() {
		return bigname;
	}

	public void setBigname(String bigname) {
		this.bigname = bigname;
	}

	public Department() {
	}

	@Override
	public String toString() {
		return "Department{" +
				"hoscode='" + hoscode + '\'' +
				", depcode='" + depcode + '\'' +
				", depname='" + depname + '\'' +
				", intro='" + intro + '\'' +
				", bigcode='" + bigcode + '\'' +
				", bigname='" + bigname + '\'' +
				'}';
	}

	@Override
	public boolean equals(Object o) {
		if (this == o) return true;
		if (o == null || getClass() != o.getClass()) return false;
		Department that = (Department) o;
		return Objects.equals(hoscode, that.hoscode) &&
				Objects.equals(depcode, that.depcode) &&
				Objects.equals(depname, that.depname) &&
				Objects.equals(intro, that.intro) &&
				Objects.equals(bigcode, that.bigcode) &&
				Objects.equals(bigname, that.bigname);
	}

	@Override
	public int hashCode() {
		return Objects.hash(hoscode, depcode, depname, intro, bigcode, bigname);
	}
}

